<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:include="/common/commonHead :: commonHead('列表管理')"></head>
<body>
<div th:replace="/common/titleNav :: titleNavDiv"></div>
<div class="content" th:with="oneMenu='2',twoMenu='5'">
    <div th:replace="/common/sidebarNav :: sidebarDiv"></div>
    <div class="main">
        <div class="right">
            <div class="title">
                <a class="btn btn-primary" href="javascript:void(0);" id="btnAdd">新增列表</a>
            </div>
            <form th:action="@{/listName/list}" method="post" id="queryForm">
                <input type="hidden" name="id" value=""/>
                <input type="hidden" name="page" th:value="${entity.page}"/>
                <input type="hidden" name="rows" th:value="${entity.rows}"/>
                <table class="table table-form">
                    <thead>
                    <tr>
                        <td width="8%"></td>
                        <td width="22%"></td>
                        <td width="8%"></td>
                        <td width="22%"></td>
                        <td width="8%"></td>
                        <td width="22%"></td>
                    </tr>
                    </thead>
                    <tbody>
                    <tr>
                        <td align="right"><span class="form-label">列表名称:</span></td>
                        <td>
                            <input type="text" class="form-control" placeholder="请输入" name="name" th:value="${entity.name}">
                        </td>
                        <td align="right"><span class="form-label">描述:</span></td>
                        <td>
                            <input type="text" class="form-control" placeholder="请输入" name="description" th:value="${entity.description}">
                        </td>
                        <td align="right"><span class="form-label">状态:</span></td>
                        <td>
                            <select class="default-basic-single" style="width:100%;" name="enabled">
                                <option value="">请选择</option>
                                <option value="1" th:selected="${entity.enabled == '1'}">启用</option>
                                <option value="0" th:selected="${entity.enabled == '0'}">禁用</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td align="right"><span class="form-label">列表类型:</span></td>
                        <td>
                            <select class="default-basic-single" style="width:100%;"  name="listType">
                                <option value="">请选择</option>
                                <option value="0" th:selected="${entity.listType == '0'}">普通列表</option>
                                <option value="1" th:selected="${entity.listType == '1'}">层叠列表</option>
                            </select>
                        </td>
                            <td align="right"><span class="form-label">apiName:</span></td>
                            <td colspan="3">
                                <input class="form-control" type="text" name="apiName" th:value="${entity.apiName}" placeholder="请输入"/>
                            </td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                        <td colspan="5">
                            <a href="javascript:void(0);" class="btn btn-primary" id="btnQuery">查询</a>
                            <a href="javascript:void(0);" class="btn btn-default border-blue"
                               style="margin-left:15px;"
                               id="btnReset">清空</a>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </form>
            <div style="overflow-x:auto; padding: 0 5px;">
                <!-- 结果列表 -->
                <table class="table table-bordered table-striped table-condensed table-hover"
                       style="table-layout: fixed;" name="resizableTable">
                    <thead>
                    <tr>
                        <th width="10%">列表名称</th>
                        <th width="10%">apiName</th>
                        <th width="20%">描述</th>
                        <th width="5%">状态</th>
                        <th width="6%">列表类型</th>
                        <th width="12%">创建时间</th>
                        <th width="12%">更新时间</th>
                        <th width="5%">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                        <tr th:entity-id="${entity.id}" th:each="entity : ${rows}">
                            <td style="text-align: left;" th:title='${entity.name}' th:text="${entity.name}"></td>
                            <td style="text-align: left;" th:title="${entity.apiName}" th:text="${entity.apiName}"></td>
                            <td style="text-align: left;" th:title="${entity.description}" th:text="${entity.description}"></td>
                            <td style="text-align: left;" th:title="${entity.enabled == 0 ? '禁用':'启用'}"  th:text="${entity.enabled == 0 ? '禁用':'启用'}"></td>
                            <td style="text-align: left;" th:title="${entity.listType == 0 ? '普通列表':'层叠列表'}" th:text="${entity.listType == 0 ? '普通列表':'层叠列表'}"></td>
                            <td style="text-align: left;" th:title="${entity.createTime}" th:text="${entity.createTime}"></td>
                            <td style="text-align: left;" th:title="${entity.updateTime}" th:text="${entity.updateTime}"></td>
                            <td>
                                <a class="action" name="edit" th:entity-id="${entity.id}"><i class="glyphicon glyphicon-edit"></i></a>
                            </td>
                        </tr>
                    </tbody>
                </table>
                <ul class="pagination" id="pagination"></ul>
                <div class="page-msg">共<span th:text="${total}"></span>记录</div>
            </div>
        </div>
    </div>
</div>
<input type="hidden" th:value="${total}" id="totalValue">
<script type="text/javascript" th:src="@{/static/javascript/admin/listName/list.js}"></script>
</body>
</html>